<title>日志</title>

<div class="layui-card layadmin-header">
  <div class="layui-breadcrumb" lay-filter="breadcrumb">
    <a lay-href="">主页</a>
    <a><cite>日志</cite></a>
    <a><cite>日志</cite></a>
  </div>
</div>

<div class="layui-fluid">

  <div class="layui-card">
    <div class="layui-card-body">
      <div class="layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="layadmin-userfront-formlist">
        <table class="layui-hide" id="table-instance" lay-filter="table-instance"></table>
      </div>
    </div>
  </div>

  <script>
    layui.use('useradmin', layui.factory('useradmin')).use(['admin', 'useradmin', 'table'], function () {
      var $ = layui.$
        , admin = layui.admin
        , view = layui.view
        , setter = layui.setter
        , table = layui.table
        , form = layui.form;

      form.render(null, 'layadmin-userfront-formlist');
      //监听搜索
      form.on('submit(LAY-user-front-search)', function (data) {
        var field = data.field;
        //执行重载
        table.reload('table-instance', {
          where: field
        });
      });
      table.render({
        elem: "#table-instance",
        url: setter.request.baseUrl + "log/list",
        method: "get",
        headers: { token: layui.data("layuiAdmin").token },
        response: {
          statusName: "code",
          statusCode: 0,
          msgName: "msg",
          countName: "totalCount",
          dataName: "log",
        },
        cols: [
          [
            { field: "username", title: "管理员昵称" },
            { field: "phone", title: "联系方式" },
            { field: "content", title: "操作内容" },
            { field: "createTime", title: "操作时间" },
          ],
        ],
        page: true,

      });
      $('.layui-btn.layuiadmin-btn-useradmin').on('click', function () {
        var type = $(this).data('type');
        active[type] ? active[type].call(this) : '';
      });
    });
  </script>